/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "MonitoringConfiguration.h"

namespace oai::udr::model {

MonitoringConfiguration::MonitoringConfiguration() {
  m_ImmediateFlag = false;
  m_ImmediateFlagIsSet = false;
  m_LocationReportingConfigurationIsSet = false;
  m_AssociationTypeIsSet = false;
  m_DatalinkReportCfgIsSet = false;
  m_LossConnectivityCfgIsSet = false;
  m_MaximumLatency = 0;
  m_MaximumLatencyIsSet = false;
  m_MaximumResponseTime = 0;
  m_MaximumResponseTimeIsSet = false;
  m_SuggestedPacketNumDl = 0;
  m_SuggestedPacketNumDlIsSet = false;
  m_PduSessionStatusCfgIsSet = false;
  m_ReachabilityForSmsCfgIsSet = false;
  m_MtcProviderInformation = "";
  m_MtcProviderInformationIsSet = false;
  m_AfId = "";
  m_AfIdIsSet = false;
}

MonitoringConfiguration::~MonitoringConfiguration() {}

void MonitoringConfiguration::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const MonitoringConfiguration &o) {
  j = nlohmann::json();
  j["eventType"] = o.m_EventType;
  if (o.immediateFlagIsSet())
    j["immediateFlag"] = o.m_ImmediateFlag;
  if (o.locationReportingConfigurationIsSet())
    j["locationReportingConfiguration"] = o.m_LocationReportingConfiguration;
  if (o.associationTypeIsSet())
    j["associationType"] = o.m_AssociationType;
  if (o.datalinkReportCfgIsSet())
    j["datalinkReportCfg"] = o.m_DatalinkReportCfg;
  if (o.lossConnectivityCfgIsSet())
    j["lossConnectivityCfg"] = o.m_LossConnectivityCfg;
  if (o.maximumLatencyIsSet())
    j["maximumLatency"] = o.m_MaximumLatency;
  if (o.maximumResponseTimeIsSet())
    j["maximumResponseTime"] = o.m_MaximumResponseTime;
  if (o.suggestedPacketNumDlIsSet())
    j["suggestedPacketNumDl"] = o.m_SuggestedPacketNumDl;
  if (o.pduSessionStatusCfgIsSet())
    j["pduSessionStatusCfg"] = o.m_PduSessionStatusCfg;
  if (o.reachabilityForSmsCfgIsSet())
    j["reachabilityForSmsCfg"] = o.m_ReachabilityForSmsCfg;
  if (o.mtcProviderInformationIsSet())
    j["mtcProviderInformation"] = o.m_MtcProviderInformation;
  if (o.afIdIsSet())
    j["afId"] = o.m_AfId;
}

void from_json(const nlohmann::json &j, MonitoringConfiguration &o) {
  j.at("eventType").get_to(o.m_EventType);
  if (j.find("immediateFlag") != j.end()) {
    j.at("immediateFlag").get_to(o.m_ImmediateFlag);
    o.m_ImmediateFlagIsSet = true;
  }
  if (j.find("locationReportingConfiguration") != j.end()) {
    j.at("locationReportingConfiguration")
        .get_to(o.m_LocationReportingConfiguration);
    o.m_LocationReportingConfigurationIsSet = true;
  }
  if (j.find("associationType") != j.end()) {
    j.at("associationType").get_to(o.m_AssociationType);
    o.m_AssociationTypeIsSet = true;
  }
  if (j.find("datalinkReportCfg") != j.end()) {
    j.at("datalinkReportCfg").get_to(o.m_DatalinkReportCfg);
    o.m_DatalinkReportCfgIsSet = true;
  }
  if (j.find("lossConnectivityCfg") != j.end()) {
    j.at("lossConnectivityCfg").get_to(o.m_LossConnectivityCfg);
    o.m_LossConnectivityCfgIsSet = true;
  }
  if (j.find("maximumLatency") != j.end()) {
    j.at("maximumLatency").get_to(o.m_MaximumLatency);
    o.m_MaximumLatencyIsSet = true;
  }
  if (j.find("maximumResponseTime") != j.end()) {
    j.at("maximumResponseTime").get_to(o.m_MaximumResponseTime);
    o.m_MaximumResponseTimeIsSet = true;
  }
  if (j.find("suggestedPacketNumDl") != j.end()) {
    j.at("suggestedPacketNumDl").get_to(o.m_SuggestedPacketNumDl);
    o.m_SuggestedPacketNumDlIsSet = true;
  }
  if (j.find("pduSessionStatusCfg") != j.end()) {
    j.at("pduSessionStatusCfg").get_to(o.m_PduSessionStatusCfg);
    o.m_PduSessionStatusCfgIsSet = true;
  }
  if (j.find("reachabilityForSmsCfg") != j.end()) {
    j.at("reachabilityForSmsCfg").get_to(o.m_ReachabilityForSmsCfg);
    o.m_ReachabilityForSmsCfgIsSet = true;
  }
  if (j.find("mtcProviderInformation") != j.end()) {
    j.at("mtcProviderInformation").get_to(o.m_MtcProviderInformation);
    o.m_MtcProviderInformationIsSet = true;
  }
  if (j.find("afId") != j.end()) {
    j.at("afId").get_to(o.m_AfId);
    o.m_AfIdIsSet = true;
  }
}

EventType MonitoringConfiguration::getEventType() const { return m_EventType; }
void MonitoringConfiguration::setEventType(EventType const &value) {
  m_EventType = value;
}
bool MonitoringConfiguration::isImmediateFlag() const {
  return m_ImmediateFlag;
}
void MonitoringConfiguration::setImmediateFlag(bool const value) {
  m_ImmediateFlag = value;
  m_ImmediateFlagIsSet = true;
}
bool MonitoringConfiguration::immediateFlagIsSet() const {
  return m_ImmediateFlagIsSet;
}
void MonitoringConfiguration::unsetImmediateFlag() {
  m_ImmediateFlagIsSet = false;
}
LocationReportingConfiguration
MonitoringConfiguration::getLocationReportingConfiguration() const {
  return m_LocationReportingConfiguration;
}
void MonitoringConfiguration::setLocationReportingConfiguration(
    LocationReportingConfiguration const &value) {
  m_LocationReportingConfiguration = value;
  m_LocationReportingConfigurationIsSet = true;
}
bool MonitoringConfiguration::locationReportingConfigurationIsSet() const {
  return m_LocationReportingConfigurationIsSet;
}
void MonitoringConfiguration::unsetLocationReportingConfiguration() {
  m_LocationReportingConfigurationIsSet = false;
}
AssociationType MonitoringConfiguration::getAssociationType() const {
  return m_AssociationType;
}
void MonitoringConfiguration::setAssociationType(AssociationType const &value) {
  m_AssociationType = value;
  m_AssociationTypeIsSet = true;
}
bool MonitoringConfiguration::associationTypeIsSet() const {
  return m_AssociationTypeIsSet;
}
void MonitoringConfiguration::unsetAssociationType() {
  m_AssociationTypeIsSet = false;
}
DatalinkReportingConfiguration
MonitoringConfiguration::getDatalinkReportCfg() const {
  return m_DatalinkReportCfg;
}
void MonitoringConfiguration::setDatalinkReportCfg(
    DatalinkReportingConfiguration const &value) {
  m_DatalinkReportCfg = value;
  m_DatalinkReportCfgIsSet = true;
}
bool MonitoringConfiguration::datalinkReportCfgIsSet() const {
  return m_DatalinkReportCfgIsSet;
}
void MonitoringConfiguration::unsetDatalinkReportCfg() {
  m_DatalinkReportCfgIsSet = false;
}
LossConnectivityCfg MonitoringConfiguration::getLossConnectivityCfg() const {
  return m_LossConnectivityCfg;
}
void MonitoringConfiguration::setLossConnectivityCfg(
    LossConnectivityCfg const &value) {
  m_LossConnectivityCfg = value;
  m_LossConnectivityCfgIsSet = true;
}
bool MonitoringConfiguration::lossConnectivityCfgIsSet() const {
  return m_LossConnectivityCfgIsSet;
}
void MonitoringConfiguration::unsetLossConnectivityCfg() {
  m_LossConnectivityCfgIsSet = false;
}
int32_t MonitoringConfiguration::getMaximumLatency() const {
  return m_MaximumLatency;
}
void MonitoringConfiguration::setMaximumLatency(int32_t const value) {
  m_MaximumLatency = value;
  m_MaximumLatencyIsSet = true;
}
bool MonitoringConfiguration::maximumLatencyIsSet() const {
  return m_MaximumLatencyIsSet;
}
void MonitoringConfiguration::unsetMaximumLatency() {
  m_MaximumLatencyIsSet = false;
}
int32_t MonitoringConfiguration::getMaximumResponseTime() const {
  return m_MaximumResponseTime;
}
void MonitoringConfiguration::setMaximumResponseTime(int32_t const value) {
  m_MaximumResponseTime = value;
  m_MaximumResponseTimeIsSet = true;
}
bool MonitoringConfiguration::maximumResponseTimeIsSet() const {
  return m_MaximumResponseTimeIsSet;
}
void MonitoringConfiguration::unsetMaximumResponseTime() {
  m_MaximumResponseTimeIsSet = false;
}
int32_t MonitoringConfiguration::getSuggestedPacketNumDl() const {
  return m_SuggestedPacketNumDl;
}
void MonitoringConfiguration::setSuggestedPacketNumDl(int32_t const value) {
  m_SuggestedPacketNumDl = value;
  m_SuggestedPacketNumDlIsSet = true;
}
bool MonitoringConfiguration::suggestedPacketNumDlIsSet() const {
  return m_SuggestedPacketNumDlIsSet;
}
void MonitoringConfiguration::unsetSuggestedPacketNumDl() {
  m_SuggestedPacketNumDlIsSet = false;
}
PduSessionStatusCfg MonitoringConfiguration::getPduSessionStatusCfg() const {
  return m_PduSessionStatusCfg;
}
void MonitoringConfiguration::setPduSessionStatusCfg(
    PduSessionStatusCfg const &value) {
  m_PduSessionStatusCfg = value;
  m_PduSessionStatusCfgIsSet = true;
}
bool MonitoringConfiguration::pduSessionStatusCfgIsSet() const {
  return m_PduSessionStatusCfgIsSet;
}
void MonitoringConfiguration::unsetPduSessionStatusCfg() {
  m_PduSessionStatusCfgIsSet = false;
}
ReachabilityForSmsConfiguration
MonitoringConfiguration::getReachabilityForSmsCfg() const {
  return m_ReachabilityForSmsCfg;
}
void MonitoringConfiguration::setReachabilityForSmsCfg(
    ReachabilityForSmsConfiguration const &value) {
  m_ReachabilityForSmsCfg = value;
  m_ReachabilityForSmsCfgIsSet = true;
}
bool MonitoringConfiguration::reachabilityForSmsCfgIsSet() const {
  return m_ReachabilityForSmsCfgIsSet;
}
void MonitoringConfiguration::unsetReachabilityForSmsCfg() {
  m_ReachabilityForSmsCfgIsSet = false;
}
std::string MonitoringConfiguration::getMtcProviderInformation() const {
  return m_MtcProviderInformation;
}
void MonitoringConfiguration::setMtcProviderInformation(
    std::string const &value) {
  m_MtcProviderInformation = value;
  m_MtcProviderInformationIsSet = true;
}
bool MonitoringConfiguration::mtcProviderInformationIsSet() const {
  return m_MtcProviderInformationIsSet;
}
void MonitoringConfiguration::unsetMtcProviderInformation() {
  m_MtcProviderInformationIsSet = false;
}
std::string MonitoringConfiguration::getAfId() const { return m_AfId; }
void MonitoringConfiguration::setAfId(std::string const &value) {
  m_AfId = value;
  m_AfIdIsSet = true;
}
bool MonitoringConfiguration::afIdIsSet() const { return m_AfIdIsSet; }
void MonitoringConfiguration::unsetAfId() { m_AfIdIsSet = false; }

} // namespace oai::udr::model
